Understanding __trashed 7: Why is it appearing in your WordPress URLs?
Seeing "__trashed 7" or similar variations (like "__trashed-2/") in your WordPress URLs can be frustrating. This suffix, or variations like "__trashed," often indicates an issue with your permalinks, specifically related to trashed and restored posts or pages. Let\'s explore why this happens and how to address it.
Why Does "__trashed" Appear?
The primary reason for "__trashed" showing up is WordPress\'s built-in mechanism to prevent URL conflicts. When you delete a post or page, WordPress adds a suffix (typically "__trashed") to its slug. This is done using the add_trashed_suffix_to_trashed_posts
PHP filter.
The purpose of this filter is to ensure that if you create a new post or page with the same slug as a previously deleted one, there won\'t be a clash. This is particularly important for SEO and user experience.
Common Scenarios Where You Might See "__trashed":
- Restored Posts/Pages: Once a page or post has been deleted and then restored, the URL *might* retain the "__trashed" suffix. As noted in WordPress.com Forums, the slug text can remain "__trashed" even after restoration.
- Accidental Deletion/Restoration: Sometimes pages or posts are unintentionally trashed and restored, leading to the suffix being added.
- Permalink Issues: In some cases, published posts can randomly get "__trashed" added to their URLs without ever being put in the trash. This is less common but can occur due to plugin conflicts or database glitches.
- Child Pages: The issue can affect child pages. As one user mentioned, "
After I made my site go live, I realized that one of the page url’s carried the words “__trashed-2/” on the end. It is a child page under a drop down menu.
"
How to Fix "__trashed" in Your URLs:
- Check Your Trash: First, make sure the affected post or page isn\'t still in the trash. If it is, permanently delete it.
- Edit the Slug Manually: This is the most straightforward solution. Go to the affected post or page in the WordPress editor. Under the "Permalink" section (or in the "URL slug" field), manually remove the "__trashed" suffix and update the post.
- Regenerate Permalinks: Go to Settings > Permalinks in your WordPress admin area. Without making any changes, simply click "Save Changes." This often resolves minor permalink issues.
- Check for Plugin Conflicts: Deactivate your plugins one by one to see if any are causing the problem. If you identify a plugin, contact its developer for support.
- Database Edit (Advanced): If the problem persists, you *could* directly edit the
wp_posts
table in your database (using phpMyAdmin or a similar tool). Find the post ID and correct thepost_name
field. Warning: This is an advanced step and should only be done if you\'re comfortable with database management. Back up your database before making any changes! - Redirection Plugin: If you can\'t remove the "__trashed" part, use a redirection plugin. It will create a redirect from the old page to the new page.
Preventing Future Issues:
- Be Careful with Bulk Actions: When deleting or moving posts/pages, double-check your selections to avoid accidentally trashing the wrong items.
- Regularly Update WordPress and Plugins: Keeping your WordPress core, themes, and plugins up to date helps prevent compatibility issues and bugs that could lead to permalink problems.
Encountering "__trashed 2" or similar errors? Following the steps above should help you resolve the problem and restore your URLs to their intended state.
¿Te ha sucedido que al intentar abrir una página web te encuentras con un mensaje de error que dice «__trashed 2»? No te preocupes, ¡aquí te mostramos cómo solucionarlo!
One example in WordPress.com Forums mentions that sleepiergirl\'s WordPress site changed some page permalinks by adding __trashed after the slug and that this slug text remains “__trashed” after restoring. Don\'t worry, this is fixable!